package top.lixunda.ecommerce.server.good.api.entity.db;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * FQA 常问问题数据表，目前由商家进行设置
 * </p>
 *
 * @author Xumda
 * @since 2020-01-06
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("frequently_question")
@ApiModel(value="FrequentlyQuestionDO对象", description="FQA 常问问题数据表，目前由商家进行设置")
public class FrequentlyQuestionDO extends Model<FrequentlyQuestionDO> {

    private static final long serialVersionUID=1L;

    @ApiModelProperty(value = "问题id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "店铺id")
    @TableField("store_id")
    private Integer storeId;

    @ApiModelProperty(value = "商品id，可以为空，为空时表示该问题属于店铺问题，作用于当前店铺所有商品")
    @TableField("good_id")
    private Integer goodId;

    @ApiModelProperty(value = "问题")
    @TableField("question")
    private String question;

    @ApiModelProperty(value = "回答")
    @TableField("answer")
    private String answer;

    @ApiModelProperty(value = "新增时间")
    @TableField("create_time")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "新增人员id")
    @TableField("create_user_id")
    private Integer createUserId;

    @ApiModelProperty(value = "新增人员名称")
    @TableField("create_user_name")
    private String createUserName;

    @ApiModelProperty(value = "更新时间")
    @TableField("update_time")
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "更新人员id")
    @TableField("update_user_id")
    private Integer updateUserId;

    @ApiModelProperty(value = "更新人员名称")
    @TableField("update_user_name")
    private String updateUserName;

    @ApiModelProperty(value = "删除时间")
    @TableField("remove_time")
    private LocalDateTime removeTime;

    @ApiModelProperty(value = "删除人员id")
    @TableField("remove_user_id")
    private Integer removeUserId;

    @ApiModelProperty(value = "删除人员名称")
    @TableField("remove_user_name")
    private String removeUserName;

    @ApiModelProperty(value = "逻辑删除")
    @TableField("useable")
    @TableLogic
    @JsonIgnore
    private Integer useable;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
